module type S = sig
  type t = float * (int -> unit)
  val i : t
  val f : int -> int
  val p : bool * int
end;;

module M : S = struct
  type t = float * (int -> unit)
  let i = (3.14, print_int)
  let f x = x + 1
  let p = (true, 42)
end;;

print_int (M.f 3);;
print_newline ();;

let module N = struct
  let g () = print_endline "hello"
end in
  N.g ()
;;

module F(X : S) = struct
  (snd X.i) (X.f (snd X.p));
  print_newline ();
end;;

module K = F(M);;
